﻿@model iMyRestaurent.Models.ProfileModel
@{
    switch (Model.Mode)
    {
        case iMyRestaurent.Shared.Mode.Create:
            ViewBag.Title = "iMyRestaurant - Create profile";
            ViewBag.NextAction = Url.Action("Create", "Location");
            ViewBag.NextMethod = "get";
            break;
        case iMyRestaurent.Shared.Mode.Edit:
            ViewBag.Title = "iMyRestaurant - Edit profile";
            ViewBag.NextAction = Url.Action("Index", "Summary");
            ViewBag.NextMethod = "post";
            break;
    }

    Layout = "~/Views/Shared/_Layout.cshtml";
    string privateText = "(private)";
}
@section import {
    @NoCache.Instance.Css(Url, "~/Content/profile.css")
}
<div id="title">@ViewBag.Title</div>
<div class="opacity-box center-box clearfix" style="width: 900px;">
    <div class="text-align-center">
        <text>Please provide you restaurant's profile information (Note all fields are mandatory)</text>
    </div>
    <div class="text-align-center error">
    </div>
    <form id="save-profile" action="/Profile/Save">
    <div class="clearfix">
        <div id="image-containment">
            <div id="image-upload">
                <input type="file" name="RestaurantImage" />
            </div>
            <div class="clearfix">
                <button type="button" class="image-button" id="delete-image">
                </button>
                <div id="image-preview-panel">
                    <div id="image-preview">
                        @if (Model.Image != null)
                        {
                            <img src="@Model.Image.ImagePath" image-id="@Model.Image.ImageID" />
                        }
                    </div>
                    <div class="clearfix">
                        <div id="view-image-chk">
                            @if (Model.Image != null && Model.Image.IsDisplay == 1)
                            {
                                <input type="checkbox" name="IsDisplay" value="true" checked="checked" />
                            }
                            else
                            {
                                <input type="checkbox" name="IsDisplay" value="true" />
                            }
                        </div>
                        <div id="view-image-lbl">
                            <span>Display</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="input-containment">
            <input type="hidden" name="RestaurantID" value="@Model.RestaurantID" />
            <div class="clearfix">
                <div class="input-label">
                    <label for="Restaurant_Name">Name of restaurant</label>
                </div>
                <div class="input-value">
                    <input type="text" name="Restaurant_Name" value="@Model.Restaurant_Name" must-filled />
                </div>
            </div>
            <div class="clearfix">
                <div class="input-label">
                    <span>Website</span>
                </div>
                <div class="input-value">
                    <input type="text" name="Website" value="@Model.Website" />
                </div>
            </div>
            <div class="clearfix">
                <div class="input-label">
                    <span>Restaurant type</span>
                </div>
                <div class="input-value">
                    @Html.DropDownListFor(m => m.Type, new SelectList(Model.RestaurantTypes, Model.Type))
                </div>
            </div>
            <div class="clearfix">
                <div class="input-label">
                    <label for="ContactPerson">Name of contact person</label>
                </div>
                <div class="input-value">
                    <input type="text" name="ContactPerson" value="@Model.ContactPerson" must-filled />
                </div>
                <div class="info">@privateText</div>
            </div>
            <div class="clearfix">
                <div class="input-label">
                    <label for="Phone">Telephone no.</label>
                </div>
                <div class="input-value">
                    <input type="text" name="Phone" value="@Model.Phone" must-filled />
                </div>
                <div class="info">@privateText</div>
            </div>
            <div class="clearfix">
                <div class="input-label">
                    <label for="Fax">Fax no.</label>
                </div>
                <div class="input-value">
                    <input type="text" name="Fax" value="@Model.Fax" must-filled />
                </div>
                <div class="info">@privateText</div>
            </div>
            <div class="clearfix">
                <div class="input-label">
                    <label for="SecretQuestion">Reset password secret question</label>
                </div>
                <div class="input-value">
                    <input type="text" name="SecretQuestion" value="@Model.SecretQuestion" must-filled />
                </div>
                <div class="info">@privateText</div>
            </div>
            <div class="clearfix">
                <div class="input-label">
                    <label for="SecretAnswer">Reset password secret answer</label>
                </div>
                <div class="input-value">
                    <input type="text" name="SecretAnswer" value="@Model.SecretAnswer" must-filled />
                </div>
                <div class="info">@privateText</div>
            </div>
            <div class="clearfix">
                <div class="input-label">
                    <label for="BillingAddress1">Billing address</label>
                </div>
                <div class="input-value">
                    <input type="text" name="BillingAddress1" value="@Model.BillingAddress1" must-filled />
                </div>
                <div class="info">@privateText</div>
            </div>
            <div class="clearfix">
                <div class="input-label hidden-label">
                    <label for="BillingAddress2">Billing address</label>
                </div>
                <div class="input-value">
                    <input type="text" name="BillingAddress2" value="@Model.BillingAddress2" must-filled />
                </div>
                <div class="info">@privateText</div>
            </div>
            <div class="clearfix">
                <div class="input-label hidden-label">
                    <label for="BillingAddress3">Billing address</label>
                </div>
                <div class="input-value">
                    <input type="text" name="BillingAddress3" value="@Model.BillingAddress3" must-filled />
                </div>
                <div class="info">@privateText</div>
            </div>
            <div class="clearfix">
                <div class="input-label">
                    <label for="Address1">Restaurant's location address</label>
                </div>
                <div class="input-value">
                    <input type="text" name="Address1" value="@Model.Address1" must-filled />
                </div>
            </div>
            <div class="clearfix">
                <div class="input-label hidden-label">
                    <label for="Address2">Restaurant's location address</label>
                </div>
                <div class="input-value">
                    <input type="text" name="Address2" value="@Model.Address2" must-filled />
                </div>
            </div>
            <div class="clearfix">
                <div class="input-label hidden-label">
                    <label for="Address3">Restaurant's location address</label>
                </div>
                <div class="input-value">
                    <input type="text" name="Address3" value="@Model.Address3" must-filled />
                </div>
            </div>
        </div>
    </div>
    </form>
</div>
@section footer {
    @if (Model.Mode == iMyRestaurent.Shared.Mode.Edit)
    {
        <button type="button" class="image-button button-back left">
        </button>
        <form action="@Url.Action("Index", "Summary")" method="post" id="back">
        <input type="hidden" name="LocationID" value="@Model.SummaryLocationID" />
        <input type="hidden" name="Date" value="@Model.SummaryDate" />
        </form>
    }
    <button type="button" class="image-button button-done right">
    </button>
    <input type="hidden" id="mode" value="@Model.Mode" />
}
@section script {
    @NoCache.Instance.Javascript(Url, "~/Scripts/jquery.form.js")
    @NoCache.Instance.Javascript(Url, "~/Scripts/profile.js")
}
